<?php
/**
 * EMLYON payment Form
 * 
 *  @author Redouane
 *  @since 21/04/2011
 */
class LoginForm extends SellerForm{
	
	public function configure(){
		$this->useFields(array('email', 'password'));
		$this->widgetSchema['password'] = new sfWidgetFormInputPassword();
		/* Labels */
		$this->widgetSchema->setLabels(array(
	      'email'      => 'Email',
	      'password'   => 'Mot de passe',
	    ));
	    
		/* Validators */
    	$this->validatorSchema['password']  	= new sfValidatorString(array('required' => true));
    	$this->validatorSchema['email']     	= new sfValidatorEmail(array('required' => true));   
    	
    	$this->validatorSchema->setPostValidator(new bay3ValidatorLogin(array(),array('invalid' => "Email ou mot de passe incorrect")));
    	
    	/* Schema */
		$this->validatorSchema['email']->setMessage('required', 'Veuillez renseigner l\'Email');
		$this->validatorSchema['email']->setMessage('invalid', 'Email invalide');
	    $this->validatorSchema['password']->setMessage('required', 'Veuillez renseigner le Mot de passe');
    	
	    $this->widgetSchema->setNameFormat('login[%s]');
		$this->widgetSchema->setFormFormatterName('div');
		$this->widgetSchema->getFormFormatter()->setTranslationCatalogue('front');
    	
	}
	
	
}